<?php
//inclui o arquivo de configuracao de paths
include_once '/application/config.php';

//require do arquivo de inicializacao da aplicacao
require_once '/application/initializer.php';
require_once "Zend/Loader.php";
require_once 'Zend/Loader/Autoloader.php';

// seta o autoload.
$loader = Zend_Loader_Autoloader::getInstance ();
$loader->setFallbackAutoloader ( true );
$loader->suppressNotFoundWarnings ( false );

// Prepara o front controller.
$frontController = Zend_Controller_Front::getInstance ();
$frontController->throwExceptions(true);
//aqui nos estamos registrando o plugin que inicia as configuracoes
$frontController->registerPlugin ( new Initializer ( PROJECT_ENV ) );

try {
	$frontController->dispatch ();
} catch ( Exception $exp ) {
	$contentType = "text/html";
	header ( "Content-Type: $contentType; charset=UTF-8" );
	echo "an unexpected error occurred.";
	echo "<h2>Unexpected Exception: " . $exp->getMessage () . "</h2><br /><pre>";
	echo $exp->getTraceAsString ();
}
?>